<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%--
  Created by IntelliJ IDEA.
  User: mingz
  Date: 2018/5/1
  Time: 13:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="/static/plugins/easyui/themes/bootstrap/easyui.css">
    <link rel="stylesheet" type="text/css" href="/static/plugins/easyui/themes/icon.css">
    <script type="text/javascript" src="/static/plugins/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="/static/plugins/easyui/jquery.easyui.min.js"></script>
    <!--引入中文包-->
    <script type="text/javascript" src="/static/plugins/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="/static/js/index.js"></script>

    <script type="text/javascript" src="/static/js/employee.js"></script>
</head>
<body>
    <%--员工表格--%>
    <table id="emp_datagrid">
    </table>

    <%--按钮--%>
    <div id="emp_toolbar">
        <a class="easyui-linkbutton" iconCls="icon-add" data-options="plain:true" data-cmd="add"/>新增</a>
        <a class="easyui-linkbutton" iconCls="icon-edit" data-options="plain:true" data-cmd="edit" />编辑</a>
        <a id = "state_btn" class="easyui-linkbutton" iconCls="icon-remove" data-options="plain:true" data-cmd="changeState" />离职</a>
        <shiro:hasPermission name="employee:updatePassword">
            <a class="easyui-linkbutton" iconCls="icon-remove" data-options="plain:true" data-cmd="changePassword" />修改密码</a>
        </shiro:hasPermission>

        <%--高级查询--%>
        <!--多条件组合查询-->
        <input class="easyui-textbox" prompt="姓名/电话" id="keyword" />
       <%-- <input class="easyui-datebox" prompt="入职日期" id="hireDate"/>--%>
        <input class="easyui-datebox" id="minTime" prompt="请输入最初时间"/>
        <input class="easyui-datebox" id="maxTime" prompt="请输入最后时间"/>
        <a class="easyui-linkbutton" iconCls="icon-mysearch" plain="true"  data-cmd="query">查询</a>
        <%--导入导出的按钮--%>
        <a class="easyui-linkbutton" iconCls="icon-emoji2" data-options="plain:true" onclick="window.open('/employee/exportXls.do')">导出</a>
        <%--上传表单--%>
        <form method="post" enctype="multipart/form-data" action="/employee/importXls.do">
            <input type="file" name="file"/>
            <input type="submit" value="导入"/>
        </form>
    </div>
    <%--表单按钮--%>
    <div id="btn">
        <a class="easyui-linkbutton" iconCls="icon-add" data-options="plain:true" data-cmd="saved"/>保存</a>
        <a class="easyui-linkbutton" iconCls="icon-edit" data-options="plain:true"  data-cmd="cancel">取消</a>
    </div>
    <div id="passwordbtn">
        <a class="easyui-linkbutton" iconCls="icon-add" data-options="plain:true" data-cmd="savePassword"/>保存</a>
        <a class="easyui-linkbutton" iconCls="icon-edit" data-options="plain:true"  data-cmd="cancel">取消</a>
    </div>



    <%--弹出窗口--%>
    <div id="emp_dialog" class="easyui-dialog" data-options="title:'编辑',iconCls:'icon-myedit',closed:true">
        <!--创建表单-->
        <form id="emp_form" method="post">
            <table align="center" style="margin-top:15px">
                <input type="hidden" name="id" id="empId"/>
                <tr>
                    <td align="center">用户名:</td>
                    <td><input name="username" class="easyui-textbox"  prompt="请输入姓名" iconCls="icon-man"
                               invalidMessage="用户名已经存在"
                               validType="remote['/employee/validate.do?id='+empId.value,'username']"
                    /></td>
                </tr>
                <tr>
                    <td align="center">真实姓名:</td>
                    <td><input name="realname" class="easyui-textbox"  prompt="请输入真实姓名" iconCls="icon-man"/></td>
                </tr>
                <tr id="psw">
                    <td align="center">密码:</td>
                    <td><input name="password"    class="easyui-passwordbox"  data-options="showEye:true" /></td>
                </tr>
                <tr>
                    <td align="center">电话:</td>
                    <td><input name="tel" class="easyui-textbox" prompt="请输入电话" /></td>
                </tr>
                <tr>
                    <td align="center">邮箱:</td>
                    <td><input name="email" class="easyui-textbox" prompt="请输入邮箱" iconCls="icon-email"
                               validType="email" /></td>
                </tr>
                <tr>
                    <td align="center">部门:</td>
                    <td><input name="dept.id" class="easyui-combobox" prompt="请选择部门" value='100'
                               data-options="panelHeight:'auto',textField:'name',valueField:'id',url:'/department/listAll.do' "/>
                    </td>
                </tr>
                <tr>
                    <td align="center">入职时间:</td>
                    <td><input name="hireDate" class= "easyui-datebox" prompt="请输入入职时间"/></td>
                </tr>
                <tr>
                    <td align="center">在职信息:</td>
                    <td><input name="state" class="easyui-combobox" prompt="请选择员工状态"
                               data-options="panelHeight:'auto',textField:'text',valueField:'value',
                    data:[{text:'在职',value:'1'},{text:'离职',value:'0'}]"/></td>
                </tr>
                <tr>
                    <td align="center">超级管理员:</td>
                    <td><input name="admin" class="easyui-combobox" prompt="是否是超级管理员"
                               data-options="panelHeight:'auto',textField:'text',valueField:'value',
                    data:[{text:'是',value:'1'},{text:'否',value:'0'}]"/></td>
                </tr>
                <%--创建角色下拉框--%>
                <tr>
                    <td align="center">角色:</td>
                    <td><input id="role_combobox" class="easyui-combobox" prompt="请选择员工角色"
                               data-options="multiple:true,panelHeight:'auto',textField:'name',valueField:'id',url:'/role/selectAll.do'"/></td>
                </tr>

            </table>
        </form>
    </div>
<%--修改密码窗口--%>
    <div id="empPassword_dialog" class="easyui-dialog" data-options="title:'编辑',iconCls:'icon-myedit',closed:true">
        <!--创建表单-->
        <form id="password_form" method="post">
            <table align="center" style="margin-top:15px">
                <input type="hidden" name="id"/>
                <tr>
                    <td align="center">新密码:</td>
                    <td><input name="password" class= "easyui-textbox" prompt="请输入密码"/></td>
                </tr>
            </table>
        </form>
    </div>
</body>
</html>
